package com.hkbigdata.userprofile.common.dao

import com.hkbigdata.userprofile.common.bean.TaskTagRule
import com.hkbigdata.userprofile.common.util.MySqlUtil

/**
 * @author liuanbo
 * @creat 2024-04-12-15:28
 * @see 2194550857@qq.com
 *
 */
object TaskTagRuleDAO {
  def TaskTagRuleDAOBytaskid(taskid: String): List[TaskTagRule] = {
    val rules = MySqlUtil.queryList(
      s"""
         |select tr.id,tr.tag_id,tr.task_id,tr.query_value,
         | sub_tag_id,ti.tag_name as sub_tag_value
         | from task_tag_rule tr,tag_info ti
         | where tr.sub_tag_id=ti.id and   tr.task_id=${taskid}
         |""".stripMargin, classOf[TaskTagRule], true)
    if (rules == None) {
      throw new RuntimeException("task id not found" + taskid)
    }
    rules
  }

}
